package com.sevenpay.wx.connection;

import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class WxUrlConstants {

	private static Logger logger = LoggerFactory.getLogger(WxUrlConstants.class);

	public static Properties properties = new Properties();
	/**
	 * 字符编码
	 */
	public static String charset = null;

	static {
		try {
			properties.load(WxUrlConstants.class.getResourceAsStream("/wx.properties"));
		} catch (IOException e) {
			logger.error("加载wx.properties属性文件异常：" + e.getMessage(), e);
		}
		
		charset = properties.getProperty("charset");
	}

	/**
	 * 获得key对应的url地址,从wx.properties文件中获取<br>
	 * 
	 * @param key
	 * @param args
	 * @return
	 */
	public static String getUrl(String key, Object... args) {
		return String.format(properties.getProperty(key), args);
	}

}
